home *** CD-ROM | disk | FTP | other *** search
/ Workbench Add-On / Workbench Add-On - Volume 1.iso / BBS-Archive / Comm / AmiTCP30b2.lha / netinclude / clib / usergroup_protos.h < prev   
C/C++ Source or Header  |  1994-05-19  |  2KB  |  89 lines

  1. #ifndef CLIB_USERGROUP_PROTOS_H
  2. #define CLIB_USERGROUP_PROTOS_H
  3. /*
  4. **    $Filename: clib/usergroup_protos.h $
  5. **    $Release$
  6. **    $Revision: 4.1 $
  7. **    $Date: 1994/05/16 14:09:07 $
  8. **
  9. **    C prototypes for usergroup.library
  10. **
  11. **    Copyright (c) 1993 AmiTCP/IP Group, <AmiTCP-Group@hut.fi>
  12. **        Helsinki University of Technology, Finland.
  13. **        All rights reserved.
  14. */
  15.  
  16. #ifndef LIBRARIES_USERGROUP_H
  17. #include <libraries/usergroup.h>
  18. #endif
  19.  
  20. #ifndef PWD_H
  21. #include <pwd.h>
  22. #endif
  23.  
  24. #ifndef GRP_H
  25. #include <grp.h>
  26. #endif
  27.  
  28. /* Setup functions */
  29. int ug_SetupContextTagList(const UBYTE* pname, struct TagItem *taglist);
  30. int ug_SetupContextTags(const UBYTE* pname,  ...);
  31. int ug_GetErr(void);
  32. const char *ug_StrError(LONG code);
  33.  
  34. /* User identification */
  35. uid_t getuid(void);
  36. uid_t geteuid(void);
  37. int setreuid(uid_t real, uid_t eff);
  38. int setuid(uid_t id);
  39.  
  40. /* Group membership */
  41. gid_t getgid(void);
  42. gid_t getegid(void);
  43. int setregid(gid_t real, gid_t eff);
  44. int setgid(gid_t id);
  45. int getgroups(int ngroups, gid_t *groups);
  46. int setgroups(int ngroups, const gid_t *groups);
  47. int initgroups(const char *name, gid_t basegroup);
  48.  
  49. /* User database */
  50. struct passwd *getpwnam(const char *name);
  51. struct passwd *getpwuid(uid_t uid);
  52. void setpwent(void);
  53. struct passwd *getpwent(void);
  54. void endpwent(void);
  55.  
  56. /* Group database */
  57. struct group *getgrnam(const char * name);
  58. struct group *getgrgid(gid_t gid);
  59. void setgrent(void);
  60. struct group *getgrent(void);
  61. void endgrent(void);
  62.  
  63. /* Password handling */
  64. char *crypt(const char *key, const char *salt);
  65. char *ug_GetSalt(const struct passwd *user, char *buffer, ULONG size);
  66. char *getpass(const char *prompt);
  67.  
  68. /* Default protections */
  69. mode_t umask(mode_t mask);
  70. mode_t getumask(void);
  71.  
  72. /* Sessions */
  73. pid_t setsid(void);
  74. pid_t getpgrp(void);
  75. char *getlogin(void);
  76. int setlogin(const char *buffer);
  77.  
  78. /* Sessions, user login database (utmp) */
  79. void setutent(void);
  80. struct utmp *getutent(void);
  81. void endutent(void);
  82. struct lastlog *getlastlog(uid_t uid);
  83. int setlastlog(uid_t uid, char *name, char *host);
  84.  
  85. /* Credentials */
  86. struct UserGroupCredentials *getcredentials(struct Task *task);
  87.  
  88. #endif /* CLIB_USERGROUP_PROTOS_H */
  89.